<template>
    <div class="app">
        <myNavbar title="商品分类"></myNavbar>
        <div class="header" @click.stop=''>
            <div class="search_input_content" @click="searchClick">
                <text class="iconTwo">&#xe62f;</text>
                <text class="search_input_content-text">请输入商品名</text>
            </div>
        </div>
        <div class="app-inner">
            <scroller class="menu" show-scrollbar="false">
                <div v-for="(item, index) in firstLevelInfo" :key="index" :class="[item.isSelsected? 'menu-item-active' : 'menu-item']"
                     @click="firstLevelTap(item.id)">
                    <text :class="[item.isSelsected? 'menu-item-text-active' : 'menu-item-text']">{{item.name}}</text>
                </div>
                <div class="bottom-placeholder"></div>
            </scroller>
            <div class="food">
                <div class="secondMenu">
                    <scroller class="secondMenuInner" show-scrollbar="false" scroll-direction="horizontal">
                        <div v-for="(item, index) in showSecondLevel" :key="index" class="secondMenuItem" @click="secondLevelTap(item.id,item.parentId)">
                            <image class="secondMenuItemImage" :src="item.thumbnail"></image>
                            <text :class="[item.isSelsected? 'secondMenuItemActive' : 'secondMenuItemText']">{{item.name}}</text>
                        </div>
                    </scroller>
                </div>
                <scroll-view
                        class="thirdMenu"
                        ref="reflectName"
                        pullTips="false"
                        @pullLoadListener="onloading">
                    <div v-for="(item, index) in thirdLevelInfo" :key="index">
                        <div class="food-layer">
                            <text class="food-layer-text">{{item.productCategoryName}}</text>
                        </div>
                        <div v-for="(productListItem, findex) in item.productList" :class="[findex == 0?'food-item-first':'food-item']" :key="findex" @click="addProductToCart(productListItem)">
                            <image class="food-item-picture" :src="productListItem.thumbnail"></image>
                            <div class="food-item-info">
                                <text class="food-item-title">{{productListItem.name}}</text>
                                <div class="food-item-price">
                                    <text class="food-item-money">￥{{productListItem.price}}</text>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="showNoMore" v-if="showNoMore"><text>---- 到底了！----</text></div>
                </scroll-view>
            </div>
        </div>

    </div>
</template>

<style scoped>
    .app {
        flex: 1;
    }

    .app-inner{
        flex: 1;
        flex-direction: row;
    }
    .header {
        position: relative;
        background-color: #f3f5f7;
    }

    .tabbar {
        flex: 1;
        margin-bottom: -2px;
    }

    .search_input_content {
        width: 710px;
        height: 58px;
        /* border: 1px solid rgba(212, 215, 220, 1); */
        opacity: 0.95;
        border-radius: 50px;
        display: flex;
        margin-left: 20px;
        flex-direction: row;
        align-items: center;
        background-color: white;
        overflow: hidden;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .icon {
        width: 50px;
        height: 50px;
        margin-left: 20px;
        margin-right: 20px;
    }

    .search_input_content-text{
        font-size: 30px;
        color: rgba(165, 165, 165, 0.705);
    }
    .menu {
        flex: 2;
        background-color: #ffffff;
    }

    .menu-item,
    .menu-item-active {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        padding: 0 20px;
        height: 112px;
        background-color: #ffffff;
    }

    .menu-item-active {
        background-color: #f3f5f7;
    }

    .menu-item-label {
        width: 24px;
        height: 24px;
        margin-right: 6px;
    }

    .menu-item-text,
    .menu-item-text-active {
        flex: 1;
        color: #666666;
        text-align: center;
        font-size: 24px;
        text-overflow: ellipsis;
        lines: 2;
    }

    .menu-item-text-active{
        color: #f01414;
    }

    .food {
        flex: 7;
    }

    .secondMenu {
        width: 580px;
        /* flex: 1; */
        padding-right: 10px;
        background-color: #f3f5f7;
    }

    .secondMenuInner {
        display: flex;
        flex-direction: row;
        align-items: center;
    }

    .secondMenuItem {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 120px;
        margin-right: 10px;
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .secondMenuItemImage {
        width: 75px;
        height: 75px;
        border-radius: 300px;
        background-color: #bfbfbf;
        margin-bottom: 20px;
    }

    .secondMenuItemText {
        font-size: 25px;
        text-align: center;
    }

    .secondMenuItemActive {
        font-size: 25px;
        color: #f01414;
        text-align: center;
    }

    .thirdMenu {
        flex: 10;
        background-color: #f3f5f7;
        padding-right: 10px;
    }

    .food-layer {
        justify-content: center;
        background-color: #f3f5f7;
        border-left-width: 4px;
        border-left-style: solid;
        border-left-color: #d9dde1;
        height: 52px;
    }

    .food-layer-text {
        color: #666666;
        font-size: 24px;
        padding-left: 20px;
    }

    .food-item {
        flex-direction: row;
        align-items: flex-start;
        margin-left: 10px;
        margin-bottom: 20px;
        background-color: white;
        border-radius: 16px;
        padding: 10px;
    }

    .food-item-first {
        flex-direction: row;
        align-items: flex-start;
        margin-left: 10px;
        background-color: white;
        border-radius: 16px;
        padding: 10px;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .food-item-picture {
        width: 200px;
        height: 200px;
        border-radius: 16px;
    }

    .food-item-info {
        margin-left: 20px;
        width: 320px;
        height: 200px;

        position: relative;
    }

    .food-item-title {
        color: #333333;
        font-size: 28px;
        font-family: PingFang SC;
        font-weight: 400;
        max-height: 80px;
        color: rgba(26, 26, 30, 1);
        line-height: 40px;
        lines: 2;
        text-overflow: ellipsis;
    }

    .food-item-desc {
        color: #999999;
        font-size: 22px;
        margin-top: 4px;
    }

    .food-item-extra {
        color: #999999;
        font-size: 22px;
        margin-top: 4px;
    }

    .food-item-price {
        width: 320px;
        flex-direction: row;
        align-items: center;
        position: absolute;
        bottom: 0;
    }

    .food-item-money {
        flex: 1;
        font-weight: bold;
        color: #f01414;
        font-size: 30px;
        margin-right: 16px;
    }

    .food-item-add {
        font-size: 48px;
        width: 50px;
        height: 50px;
        color: #00a0dc;
    }

    .food-item-number {
        color: #666666;
        font-size: 26px;
        text-align: center;
        padding: 0 3px;
    }

    .bottom {
        position: absolute;
        left: 0;
        bottom: 30px;
        /* width: 250px; */
        padding-right: 20px;
        height: 80px;
        flex-direction: row;
        align-items: center;
        border-top-right-radius: 40px;
        border-bottom-right-radius: 40px;
        /* justify-content: flex-end; */
        background-image: linear-gradient(to right, rgb(179, 178, 177), rgb(231, 231, 230));
    }

    .bottom-placeholder {
        width: 750px;
        height: 100px;
    }

    .bottomInner {
        width: 100px;
        height: 80px;
        position: relative;
        justify-content: center;
        align-items: center;
    }

    .bottom-box-cart-icon {
        font-size: 50px;
        color: #ffffff;
    }

    .bottom-box-cart-num {
        position: absolute;
        top: 0px;
        left: 50px;
        font-size: 20px;
        text-align: center;
        padding: 0 11px;
        height: 36px;
        line-height: 36px;
        color: #ffffff;
        background-color: #ff0000;
        border-radius: 18px;
        z-index: 100;
    }



    .bottom-info-price,
    .bottom-info-price-not {
        color: #ff0000;
        font-size: 34px;
        font-weight: 600;
        padding-right: 20px;
        border-left-style: solid;
        border-left-width: 1px;
        border-left-color: #000;
        padding-left: 15px;
    }

    .bottom-info-price-not {
        color: #fff;
    }

    .bottom-info-desc {
        flex: 1;
        border-left-width: 2px;
        border-left-style: solid;
        border-left-color: #0b1b2b;
        padding-left: 20px;
        font-size: 24px;
        color: #999999;
    }

    .bottom-info-button,
    .bottom-info-button-not {
        background-color: #00b43c;
        color: #ffffff;
        font-weight: 600;
        width: 210px;
        height: 112px;
        line-height: 112px;
        text-align: center;
        font-size: 24px;
    }

    .bottom-info-button-not {
        background-color: #333333;
        color: #999999;
    }

    .showNoMore{
        width: 550px;
        height: 40px;
        align-items: center;
        justify-content: center;
    }

    .title2 {
        font-family: iconfont2;
    }
    .iconTwo {
        font-family: iconfont2;
        font-size: 39px;
        color: rgba(42, 42, 54,1);
        opacity: 0.3;
        margin-left: 20px;
        margin-right: 20px;
    }
</style>

<script>
    const eeui = app.requireModule('eeui');
    const modal = weex.requireModule('modal');
    const storage = weex.requireModule('storage')
    import {
        list
    } from '../../../api/product'

    import {
       list as productCategoryList
    } from '../../../api/productCategory'
    import {
        count
    } from '../../../api/cart'

    import noData from "@/components/noData/noData.vue";
    import myNavbar from "../../../components/myNavbar/myNavbar.vue";

    export default {
        components: {
            noData,
            myNavbar
        },
        data() {
            return {
                sellerInfo: {},

                active: 0,
                lists: [],
                cartShow: false,
                cartNum: 0,
                cartMoney: 0,

                pageNum: 1,
                pageSize: 10,
                adSrc: "http://cdn.rzico.com/v4.0/test1.png",
                firstLevelInfo: [],
                showSecondLevel: [],
                productInfoCache: [], //缓存下一页的数据
                isShowSecond: true, //是否显示二级分类
                secondLevelInfo: [],
                thirdLevelInfo: [],
                currentFirstId: "",
                currentSecondId: "",
                currentFirstIndex: "", //目前被选中的一级分类下标
                currentSecondIndex: "", //目前被选中的二级分类下标

                firstLevelScrollTop: 0, //一级的纵向滑动位置
                secondLevelScrollLeft: 0, //二级的横向滑动位置
                toIndex: "",
                showNoMore:false,
                count:0,
            }
        },


        created() {
            this.initIconFont()
            let optionsId = app.config.params
            let _this = this
            this.getCategoryList(() => {
                //console.info("optionsId-*-" + optionsId)
                if (_this.isNull(optionsId)) {
                    this.currentFirstId = this.firstLevelInfo[0].id
                    this.firstLevelFun(this.currentFirstId, true)
                }
                // else {
                //     //console.info("二级分类的数据secondLevelInfo-*-" + this.secondLevelInfo.length)
                //     let off = true
                //     if (this.firstLevelInfo.length > 0) {
                //         this.firstLevelInfo.map((item, index) => {
                //             if (item.id == optionsId) {
                //                 this.currentFirstId = optionsId
                //                 off = false
                //                 this.currentFirstIndex = index
                //                 this.firstLevelFun(this.currentFirstId, true,)
                //             }
                //         })
                //     }
                //     if (off) {
                //         //console.info("off-*-" + off)
                //         if (this.secondLevelInfo.length > 0) {
                //             this.secondLevelInfo.map(item => {
                //                 if (optionsId == item.id) {
                //                     //console.info("我被找到了--" + JSON.stringify(item))
                //                     this.currentFirstId = item.parentId
                //                     this.currentSecondId = item.id
                //                     //为什么要一级请求后在二级请求
                //                     this.firstLevelFun(this.currentFirstId, false, () => {
                //                         _this.secondLevelFun(this.currentSecondId, () => {
                //                             if (this.firstLevelInfo.length > 0) {
                //                                 this.firstLevelInfo.map((item, index) => {
                //                                     if (item.id == this.currentFirstId) {
                //                                         this.currentFirstIndex = index
                //                                     }
                //                                 })
                //                             }
                //                             if (this.showSecondLevel.length > 0) {
                //                                 this.showSecondLevel.map((item, index) => {
                //                                     if (item.id == this.currentSecondId) {
                //                                         this.currentSecondIndex = index
                //                                     }
                //                                 })
                //                             }
                //                         })
                //                     })
                //                 }
                //             })
                //         }
                //     }
                // }
            })
        },

        mounted() {
            this.$refs.reflectName.setHasMore(true);
        },

        methods: {
            //搜索框的点击事件
            searchClick() {
                eeui.openPage({
                        url: 'root://pages/member/search/index.js',
                        statusBarType: 'immersion',
                        statusBarStyle:false
                    },
                    (result) => {
                        if (result.status == 'stop'){
                            storage.getItem('productAdd', event => {
                                if (event.result == 'success'){
                                    eeui.closePage()
                                }
                            })
                        }
                    }
                );
            },

            detailsClick(id) {
                eeui.openPage({
                    params: id,
                    url: 'root://pages/goods/product/details.js',
                    statusBarType: 'immersion',
                    statusBarStyle:false,
                })
            },

            //获取分类列表的信息
            getCategoryList(callback) {
                let _this = this
                // //console.info("一级分类的数据app.globalData.mchId-*-" + JSON.stringify(this.getGlobalData().mchId))
                productCategoryList({
                    mchId: this.getGlobalData().mchId
                }).then(
                    res => {
                        if (res.type == 'success') {
                            _this.formateDateFromFirstAndSecond(res.data)
                            if (callback) {
                                callback()
                            }
                        }
                    }
                ).catch(error => {
                    //console.info(error)
                })
            },

            //获取商品列表信息
            getProductrequest(id, isFirst, callback) {
                let _this = this
                let pageSize = _this.pageSize
                if (isFirst) { //首次请求多请求一组数据
                    pageSize *= 2
                    list({
                        pageNum: _this.pageNum,
                        pageSize: pageSize,
                        mchId: this.getGlobalData().mchId,
                        productCategory: id,
                    }).then(
                        res => {
                            if (res.type == 'success') {
                                if (res.data.data.length > _this.pageSize) {
                                    this.productInfoCache = res.data.data.slice(_this.pageSize)
                                } else {
                                    this.showNoMore= true
                                }
                                if (callback) {
                                    callback(res.data.data.slice(0, _this.pageSize))
                                }
                            }
                        }
                    ).catch(error => {

                    })
                } else { //后续请求
                    list({
                        pageNum: _this.pageNum,
                        pageSize: _this.pageSize,
                        mchId: this.getGlobalData().mchId,
                        productCategory: id,
                        sortField: "product_category_id"
                    }).then(
                        res => {
                            //console.info("我是后续请求的商品信息res--" )
                            if (res.type == 'success') {
                                if (callback) {
                                    callback(this.productInfoCache)
                                }
                                if(res.data.data.length > 0){
                                    this.productInfoCache = res.data.data
                                }else{
                                    this.showNoMore= true
                                    this.productInfoCache=[]
                                }
                            }
                        }
                    ).catch(error => {
                        //console.info(error)
                    })
                }
            },

            //整理一级和二级分类数据
            formateDateFromFirstAndSecond(data) {
                if (data.length > 0) {
                    let firstLevelInfo = []
                    let secondLevelInfo = []
                    // ////console.info("一二级分类的数据data-*-" + JSON.stringify(data))
                    data.map((item) => {
                        let firstLevelInfoItem = {}
                        firstLevelInfoItem.id = item.id
                        firstLevelInfoItem.name = item.name
                        firstLevelInfoItem.thumbnail = item.thumbnail
                        firstLevelInfoItem.isShow = item.isShow
                        firstLevelInfoItem.isSelsected = false
                        firstLevelInfo.push(firstLevelInfoItem)
                        if (item.childrens.length > 0) {
                            item.childrens.map((item1) => {
                                let secondLevelInfoItem = {}
                                secondLevelInfoItem.parentId = item.id
                                secondLevelInfoItem.id = item1.id
                                secondLevelInfoItem.name = item1.name
                                secondLevelInfoItem.thumbnail = this.thumbnail(item1.thumbnail, 75, 75)
                                secondLevelInfoItem.isShow = item1.isShow
                                secondLevelInfoItem.isSelsected = false
                                secondLevelInfo.push(secondLevelInfoItem)
                            })
                        }
                    })
                    this.firstLevelInfo= firstLevelInfo,
                        this.secondLevelInfo= secondLevelInfo
                }
            },

            //整理商品列表数据
            formateDateFromProductList(data, type, callback) {
                let thirdLevelInfoNew = []
                let thirdLevelIdList = []
                if (data.length > 0) {
                    data.map((item) => {
                        thirdLevelIdList.push(item.productCategoryId)
                    })
                    thirdLevelIdList = Array.from(new Set(thirdLevelIdList)); //父级id去重
                    if (thirdLevelIdList.length > 0) {
                        thirdLevelIdList.map((item) => {
                            let thirdLevelInfoItem = {}
                            thirdLevelInfoItem.productCategoryId = item
                            thirdLevelInfoItem.productList = []
                            data.map((item1) => {
                                if (item == item1.productCategoryId) {
                                    item1.thumbnail = this.thumbnail(item1.thumbnail,200,200)
                                    thirdLevelInfoItem.productCategoryName = item1.productCategoryName
                                    thirdLevelInfoItem.productList.push(item1)
                                    console.log(item1)
                                }
                            })
                            thirdLevelInfoNew.push(thirdLevelInfoItem)
                        })
                    }
                    let thirdLevelInfo = []
                    if (type == "push") {
                        thirdLevelInfo = this.thirdLevelInfo
                        if (thirdLevelInfo.length > 0 && thirdLevelInfoNew.length > 0) {
                            let thirdLevelInfoNewIdList = [] //暂存遍历未找到的三级分类
                            thirdLevelInfoNew.map((item) => {
                                let checkOff = true
                                thirdLevelInfo.map((item1) => {
                                    if (item1.productCategoryId == item.productCategoryId) {
                                        checkOff = false
                                        if (item.productList) {
                                            item.productList.map((item2) => {
                                                item1.productList.push(item2)
                                            })
                                        }
                                    }
                                })
                                if (checkOff) {
                                    thirdLevelInfoNewIdList.push(item.productCategoryId)
                                }
                            })
                            if (thirdLevelInfoNewIdList.length > 0 && thirdLevelInfoNew.length > 0) {
                                thirdLevelInfoNewIdList.map((item) => {
                                    thirdLevelInfoNew.map((item1) => {
                                        if (item == item1.productCategoryId) {
                                            thirdLevelInfo.push(item1)
                                        }
                                    })

                                })
                            }
                        }
                    } else {
                        thirdLevelInfo = thirdLevelInfoNew
                    }
                    this.thirdLevelInfo = thirdLevelInfo
                    // //console.info("thirdLevelInfo--" + JSON.stringify(this.thirdLevelInfo))
                } else {
                    // this.thirdLevelInfo= []
                }
                if(callback){
                    callback()
                }
            },

            //点击购物车事件
            addProductToCart(product) {
                eeui.closePage()
                storage.setItem('productAdd', JSON.stringify(product), event => {

                })
            },

            //一级分类的事件
            firstLevelFun(id, needGetProduct, callback) {
                let _this = this
                let isShowSecond = _this.isShowSecond
                let firstLevelInfo = this.firstLevelInfo
                let secondLevelInfo = this.secondLevelInfo
                let showSecondLevel = []
                if (firstLevelInfo.length > 0) {
                    firstLevelInfo.map((item) => {
                        if (item.id == id) {
                            // if (item.isSelsected == false) {
                            item.isSelsected = true
                            //console.info("开始发送请求");
                            //发送请求
                            if (needGetProduct) {
                                _this.getProductrequest(id, true, (data) => {
                                    _this.formateDateFromProductList(data)
                                    this.pageNum = 2
                                })
                            }
                        } else {
                            item.isSelsected = false
                        }
                    })
                }
                if (secondLevelInfo.length > 0) {
                    secondLevelInfo.map((item) => {
                        if (item.parentId == id) {
                            item.isSelsected = false
                            showSecondLevel.push(item)
                        }
                    })
                    if (showSecondLevel.length > 0) {
                        isShowSecond = true
                    } else {
                        isShowSecond = false
                    }
                }
                console.log(showSecondLevel)
                if (!this.isNull(showSecondLevel)){
                    let toIndex = "secondLevel" + showSecondLevel[0].id
                    this.toIndex= toIndex
                }
                this.isShowSecond= isShowSecond
                this.firstLevelInfo= firstLevelInfo
                this.showSecondLevel= showSecondLevel
                if (callback) {
                    callback()
                }
            },

            //一级分类的点击事件
            firstLevelTap(id) {
                this.pageNum = 1
                this.currentFirstId = id
                this.currentSecondId = ""
                this.productInfoCache= []
                this.thirdLevelInfo= []
                this.pageNum= 1
                this.showNoMore= false
                //console.info("一级分类点击的事件pageNum--" + this.pageNum)
                this.firstLevelFun(id, true)
            },

            //二级分类数据请求事件
            secondLevelFun(id, callback) {
                //console.info("id" + JSON.stringify(id));
                let _this = this
                let showSecondLevel = this.showSecondLevel
                //console.info("showSecondLevel" + JSON.stringify(showSecondLevel));
                if (showSecondLevel.length > 0) {
                    showSecondLevel.map((item) => {
                        // //console.info("item" + JSON.stringify(item));
                        if (item.id == id) {
                            // if (item.isSelsected == false) {
                            item.isSelsected = true
                            //console.info("开始发送请求");
                            _this.getProductrequest(id, true, (data) => {
                                _this.formateDateFromProductList(data)
                                this.pageNum = 2
                                if (callback) {
                                    callback()
                                }
                            })
                            // }

                        } else {
                            item.isSelsected = false
                        }
                    })
                }
                this.showSecondLevel= showSecondLevel
                // this.$refs.myScroll.smoothScrollToPosition(0)
            },

            //二级分类点击事件
            secondLevelTap(id,parentid) {
                //console.info("二级点击事件id--" + id)
                //console.info("二级点击事件parentid--" + parentid)
                this.currentFirstId = parentid
                this.currentSecondId = id
                this.productInfoCache= []
                this.thirdLevelInfo= []
                this.pageNum= 1
                this.showNoMore= false
                this.secondLevelFun(id)
            },

            //上啦加载
            onloading() {
                let _this = this
                let showSecondLevel = this.showSecondLevel
                ////console.info("下拉刷新的时间被触发showSecondLevel--"+JSON.stringify(showSecondLevel))
                let selectIndex = ""
                let id = ""
                let checkNext = this.checkNext
                // if(this.productInfoCache.length == this.pageSize){
                let pageNum = this.pageNum
                pageNum++
                this.pageNum = pageNum
                if (this.isNull(this.currentSecondId)) {
                    if (this.productInfoCache.length == this.pageSize) {
                        _this.formateDateFromProductList(this.productInfoCache, "push",()=>{
                            _this.getProductrequest(this.currentFirstId, false)
                        })
                    } else {
                        if (this.productInfoCache.length > 0) {
                            _this.formateDateFromProductList(this.productInfoCache, "push")
                            this.productInfoCache = []
                            this.showNoMore= true
                        } else {
                            this.showNoMore= true
                            // this.$refs.reflectName.setHasMore(false);
                            // this.$refs.myScroll.smoothScrollToPosition(0)
                        }
                    }
                    // //console.info("缓存的数量--"+this.productInfoCache.length)
                } else {
                    // //console.info("我是二级的上拉加载事件-------------------------")
                    let currentIndex = ""
                    // if (this.showSecondLevel.length > 0) {
                    //         this.showSecondLevel.map((item, index) => {
                    //                 if (item.id == this.currentSecondId) {
                    //                         currentIndex = index
                    //                 }
                    //         })
                    //         if (this.pageNum == 2) {
                    //                 let showSecondLevel = this.showSecondLevel
                    //                 showSecondLevel.map(item => {
                    //                         if (item.id == this.currentSecondId) {
                    //                                 item.isSelsected = true
                    //                         } else {
                    //                                 item.isSelsected = false
                    //                         }
                    //                 })
                    //                 this.setData({
                    //                         showSecondLevel: showSecondLevel
                    //                 })
                    //         }
                    // }

                    // //console.info("缓存的长度--" + this.productInfoCache.length)
                    if (this.productInfoCache.length == this.pageSize) {
                        _this.getProductrequest(this.currentSecondId, false, (data) => {
                            _this.formateDateFromProductList(data, "push")
                        })
                    } else if (this.productInfoCache.length > 0) {
                        _this.formateDateFromProductList(this.productInfoCache, "push")
                        this.productInfoCache = []
                        // //console.info(JSON.stringify(this.thirdLevelInfo))
                        this.showNoMore= true
                        // let scrollTop = this.scrollTop - 40
                        // wx.pageScrollTo({
                        // 	scrollTop: scrollTop,
                        // 	duration: 300
                        // })
                    } else {
                        this.showNoMore= true
                        // this.$refs.reflectName.setHasMore(false);
                        // let scrollTop = this.scrollTop - 40
                        // wx.pageScrollTo({
                        // 	scrollTop: scrollTop,
                        // 	duration: 300
                        // })
                    }
                }
                this.$refs.reflectName.pullloaded();
            },




        }
    }
</script>
